package com.dy.nygl.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.nygl.mapper.DepartmentMapper;
import com.dy.nygl.pojo.Department;
import com.dy.nygl.service.DepartmentService;

@Service("departmentService")
public class DepartmentServiceImpl implements DepartmentService{

	@Resource(name="departmentDAO")
	private DepartmentMapper departmentDAO;
	
	public List<Department> getDepartment() {
		
		List<Department> list = departmentDAO.getDepartmentAllList();
		if(list.size()>0) {
			return list;
		}
		return null;
	}
	
	public Department getDepartmentById(int id) {
		Department department = departmentDAO.getDepartmentById(id);
		if(department != null) {
			return department;
		}
		return null;
	}

}
